Skip to content

Conversation

@leo-generali
Copy link
Collaborator

Description

  • Creates the final screen of the "Create Mock Data" generator flow:
CleanShot 2025-09-04 at 15 00 38@2x

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@evergreen-ci-prod
Copy link

There is an existing patch(es) for this commit SHA:

Please note that the status that is posted is not in the context of this PR but rather the (latest) existing patch and that may affect some tests that may depend on the particular PR. If your tests do not rely on any PR-specific values (like base or head branch name) then your tests will report the same status. If you would like a patch to run in the context of this PR and abort the other(s), comment 'evergreen retry'.

@leo-generali leo-generali force-pushed the CLOUDP-333859-script-output-screen branch from b85a359 to 9ef8bbd Compare September 8, 2025 15:38
@leo-generali leo-generali added the no release notes Fix or feature not for release notes label Sep 8, 2025
@leo-generali leo-generali marked this pull request as ready for review September 8, 2025 15:39
@leo-generali leo-generali requested a review from a team as a code owner September 8, 2025 15:39
@leo-generali leo-generali changed the title feat(compass-collection) Fill in the script screen of the Generate Mock Data modal flow feat(compass-collection): Fill in the script screen of the Generate Mock Data modal flow Sep 8, 2025
@leo-generali leo-generali changed the title feat(compass-collection): Fill in the script screen of the Generate Mock Data modal flow feat(compass-collection): Fill in the script screen of the Generate Mock Data modal flow CLOUDP-333859 Sep 8, 2025
Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, left two comment on rendering and css.

{stepContent}
<div data-testid={`generate-mock-data-step-${currentStep}`} />
<div data-testid={`generate-mock-data-step-${currentStep}`}>
{STEP_TO_STEP_CONTENT[currentStep]}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of a nit, instead of instantiating these components on load, can we instead write this with a switch? Either in a function or a variable. That way we create them when we're rendering.

Here's an example in the code base:

If we want to keep the Record approach, using functions would also work:

const STEP_TO_STEP_CONTENT: Record<MockDataGeneratorStep, React.JSX.Element> = {
  [MockDataGeneratorStep.SCHEMA_CONFIRMATION]: () => <SchemaConfirmationScreen />,
  [MockDataGeneratorStep.SCHEMA_EDITOR]: () => <FakerSchemaEditor />,
  [MockDataGeneratorStep.DOCUMENT_COUNT]: () => <></>, // TODO: Implement as part of CLOUDP-333856
  [MockDataGeneratorStep.PREVIEW_DATA]: () => <></>, // TODO: Implement as part of CLOUDP-333857
  [MockDataGeneratorStep.GENERATE_DATA]: () => <ScriptScreen />,
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Went with the useMemo approach used in the linked code.

@leo-generali leo-generali requested a review from Anemy September 8, 2025 18:54
Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Collaborator

@jcobis jcobis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Wondering about the slight difference in how the password and the username are displayed (one placeholder is surrounded with quotes while the other is not). Asked designs here

@leo-generali leo-generali merged commit 59e3b43 into main Sep 8, 2025
56 of 57 checks passed
@leo-generali leo-generali deleted the CLOUDP-333859-script-output-screen branch September 8, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants